<?php
/*
To test uncomment below code and comment line no. 14,15,16,30 & 32.
$username = 'username';
$password = 'password';
$roleID = 1;

$result = removeShift($username,$password,$roleID);
echo(json_encode($result));
*/

function removeShift($authUser, $authUserPass, $shiftToDelete)
{
      if (checkAuthorization($authUser, $authUserPass) != true){
	     return array(ErrorCode::authFailRead);
      }

      $conn = mysql_connect('localhost','root','');
      mysql_select_db('paradigmShift_DEV');

      if(!$conn)
      {
           die('Could not connect: ' . mysql_error());
         return array(ErrorCode::sysError);
      }

      $sql = "DELETE FROM roledates WHERE roleID='$shiftToDelete'";

      if (mysql_query($sql)){
       return array('ErrorCode::SuccessDelete');
      } else {
        return array('ErrorCode::failDelete');
      }
      mysql_close($conn);
}
?>